Completed
Push — master ( 675e71...1fbf32 )
by greg
01:38
created

meta.js ➔ ... ➔ before   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 11
rs 9.4285
nop 1
1
var chai = require('chai');
2
var path = require('path');
3
4
var config = require('../src/cli').config
5
config.set({root: __dirname + '/fixtures/'})
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
6
7
var cmsData = require('../src/cli').cmsData;
8
var Manager = require('../src/cli').Manager;
9
var fse = require('fs-extra');
10
11
describe('Meta', function() {
12
  before( function(done) {
13
    Manager.instance.init()
14
      .then(function () {
15
16
        this.fixture = {
17
          tag: fse.readFileSync(__dirname + '/fixtures/templates/article.html', 'utf8')
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
18
        }
19
        done()
20
        
21
      }.bind(this))
22
  });
23
24
  /**
25
   * cmsData.meta.add
26
   * 
27
   */
28
  it('cmsData.metas.add()', function() {
29
    var json = {abe_meta: {link: 'article.html'}};
30
    cmsData.metas.add('article', json);
31
    chai.expect(json.abe_meta.date).to.not.be.undefined;
0 ignored issues
show
introduced by
The result of the property access to chai.expect(json.abe_met...te).to.not.be.undefined is not used.
Loading history...
32
  });
33
});
34